<?php

declare(strict_types=1);

namespace App\Service;

use App\Core\Rpc\Client;
use HyperfExt\Auth\Contracts\AuthenticatableInterface;

/**
 * 登录授权管理
 * @author lihaiping
 */
class AuthAccountService extends Client
{
    /**
     * 定义对应服务提供者的服务名称
     * @var string
     */
    protected $serviceName = 'UserCenterService';

    /**
     * 定义对应服务提供者的服务协议
     * @var string
     */
    protected $protocol = 'jsonrpc-http';

    /**
     * The load balancer of the client, this name of the load balancer
     * needs to register into \Hyperf\LoadBalancer\LoadBalancerManager.
     *
     * @var string
     */
    protected $loadBalancer = 'random';

    /**
     *  检查token
     * @param string $token
     * @return AuthenticatableInterface|null
     */
    public function checkUpToken(string $token): ?array
    {
        return $this->__request(__FUNCTION__, compact('token'));
    }
}
